<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-material.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"blog.yookingh.cn","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":true},"bookmark":{"enable":true,"color":"#00000000","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="大事记公司大事件     graph TB     Company(甲方-乙方公司) -- 2019.11.11 --&gt; 成立     Company --- Project(项目)     Company --- Human(人员)     Human -- 2019.11.11 --&gt; 任命     Appoint[人员任命] --&gt; PartyA(甲方)      PartyA --&gt; Al">
<meta property="og:type" content="article">
<meta property="og:title" content="项目开发-从零开始记账本">
<meta property="og:url" content="http://blog.yookingh.cn/dev/191118-bookkeeping.html">
<meta property="og:site_name" content="墨染青葱几许烟">
<meta property="og:description" content="大事记公司大事件     graph TB     Company(甲方-乙方公司) -- 2019.11.11 --&gt; 成立     Company --- Project(项目)     Company --- Human(人员)     Human -- 2019.11.11 --&gt; 任命     Appoint[人员任命] --&gt; PartyA(甲方)      PartyA --&gt; Al">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2020/04/30/HqK3etgyh6VIFmA.png">
<meta property="og:image" content="https://i.loli.net/2020/04/30/hQY3BijdoJqSMb8.png">
<meta property="og:image" content="https://i.loli.net/2020/04/30/oVl2KwqiHGQfhMv.png">
<meta property="og:image" content="https://i.loli.net/2020/04/30/SQ1m9Kz2TgMqbF4.png">
<meta property="og:image" content="https://i.loli.net/2020/04/30/vzS8WPpVumBTAHe.png">
<meta property="og:image" content="https://i.loli.net/2020/04/30/T37HXri18xBtsIh.png">
<meta property="article:published_time" content="2019-11-18T03:25:39.000Z">
<meta property="article:modified_time" content="2020-05-14T10:59:13.781Z">
<meta property="article:author" content="yooking">
<meta property="article:tag" content="Java">
<meta property="article:tag" content="Flutter">
<meta property="article:tag" content="Dart">
<meta property="article:tag" content="项目开发">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2020/04/30/HqK3etgyh6VIFmA.png">

<link rel="canonical" href="http://blog.yookingh.cn/dev/191118-bookkeeping.html">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>项目开发-从零开始记账本 | 墨染青葱几许烟</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">墨染青葱几许烟</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">左手代码 右手诗意</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-首页">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-时间轴">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>时间轴</a>

  </li>
        <li class="menu-item menu-item-标签云">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签云</a>

  </li>
        <li class="menu-item menu-item-关于&留言">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于&留言</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

  <a href="https://github.com/yooking-git" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://blog.yookingh.cn/dev/191118-bookkeeping.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/imgs/a_icon_head.jpg">
      <meta itemprop="name" content="yooking">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="墨染青葱几许烟">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          项目开发-从零开始记账本
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-11-18 11:25:39" itemprop="dateCreated datePublished" datetime="2019-11-18T11:25:39+08:00">2019-11-18</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/dev/" itemprop="url" rel="index"><span itemprop="name">想丶给代码码上诗意</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/dev/191118-bookkeeping.html#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/dev/191118-bookkeeping.html" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="大事记"><a href="#大事记" class="headerlink" title="大事记"></a>大事记</h1><h2 id="公司大事件"><a href="#公司大事件" class="headerlink" title="公司大事件"></a>公司大事件</h2><pre class='mermaid'>
    graph TB
    Company(甲方-乙方公司) -- 2019.11.11 --> 成立
    Company --- Project(项目)
    Company --- Human(人员)
    Human -- 2019.11.11 --> 任命
    Appoint[人员任命] --> PartyA(甲方) 
    PartyA --> All(全体成员)
    Appoint[人员任命] --> PartyB(乙方)
    PartyB -- PM --> PM(胖子)
    PartyB -- UI --> UI(花花)
    PartyB -- RD --> RD(yooking)
</pre>

<a id="more"></a>

<h2 id="项目时间轴"><a href="#项目时间轴" class="headerlink" title="项目时间轴"></a>项目时间轴</h2><pre class='mermaid'>
    graph TB
    Project2[项目时间轴] 
    Project2 --> P1[2019.11.11-项目立项]
    P1 --> P2[2019.11.11-确立目标]
    P2 --> P3[2019.11.11-第一份需求文档]
    P3 --> P4[2019.11.17-第一份产品文档]
    P4 --> P5[2019.11.19-第一份流程图]
    P5 --> P6[2019.11.19-项目代码构建]
</pre>

<h2 id="文档路径"><a href="#文档路径" class="headerlink" title="文档路径"></a>文档路径</h2><ul>
<li>第一份 <a style="color:#1196EE" href="https://i.loli.net/2020/04/30/uqCQAsbwjR67OVz.jpg" target="view_window">需求文档</a> 诞生</li>
<li>第一份 <a style="color:#1196EE" href="../../../../files/191118-bookkeeping/requirementsDocument-1.pdf" target="view_window">产品文档</a> 诞生</li>
<li>第一份 <a style="color:#1196EE" href="https://i.loli.net/2020/04/30/D4xlmPinYOuW9Lw.jpg" target="view_window">流程图</a> 诞生</li>
<li>前端项目创建：[github开源]</li>
</ul>
<h1 id="开发笔记"><a href="#开发笔记" class="headerlink" title="开发笔记"></a>开发笔记</h1><h2 id="开发环境"><a href="#开发环境" class="headerlink" title="开发环境"></a>开发环境</h2><h2 id="System-And-Software"><a href="#System-And-Software" class="headerlink" title="System And Software"></a>System And Software</h2><figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Windows 7/10</span><br><span class="line">Android Studio 3.4.2</span><br><span class="line">IDE/MyEclipse/Eclipse</span><br><span class="line">Java/Dart/H5</span><br></pre></td></tr></table></figure>

<!--### Android Settings

    project name: bookkeeping
    project package: com.yooking.bookkeeping
    project language: kotlin
    project mininum API:API19 - kitkat - Android 4.4
-->

<h2 id="开发规划"><a href="#开发规划" class="headerlink" title="开发规划"></a>开发规划</h2><ol>
<li>Flutter 多平台开发</li>
<li>Java 后台开发</li>
<li>前后端联动</li>
<li>公众号开发</li>
</ol>
<h2 id="开发进度"><a href="#开发进度" class="headerlink" title="开发进度"></a>开发进度</h2><pre class='mermaid'>
    graph TB
    Dev[开发进度] 
    Dev --> D1[2019.11.19-配置开发环境]
    D1 --> D2[2019.11.19-创建项目]
    D2 --> D3[2019.11.19-HelloWorld]
    D3 --> D4[2019.11.22-自定义日历页]
</pre>


<h2 id="开发详情"><a href="#开发详情" class="headerlink" title="开发详情"></a>开发详情</h2><h3 id="环境配置"><a href="#环境配置" class="headerlink" title="环境配置"></a>环境配置</h3><p>Android Studio 配置 Flutter 详细流程：</p>
<ul>
<li><p>1、引入 github 项目: /d/Flutter/ <code>$ git clone https://github.com/flutter/flutter.git</code></p>
</li>
<li><p>2、在引入 github 项目的同时，可同步操作：</p>
<ul>
<li>2.1、打开 Android Studio</li>
<li>2.2、点击 Configure</li>
<li>2.3、选择 Plugins</li>
<li>2.4、搜索 Dart 插件和 Flutter 插件并下载</li>
<li>2.5、关闭 Android Studio</li>
</ul>
</li>
<li><p>3、配置环境变量</p>
<ul>
<li>3.1、环境变量 Path = <code>D:\Flutter\flutter\bin</code></li>
<li>3.2、powershell 中执行 <code>flutter doctor</code>(报错1)</li>
</ul>
<p>报错1：<br>无法将“Unblock-File”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写，如果包括路径，请确保路径正确，然后重试。<br>所在位置 行:1 字符: 13</p>
<figure class="highlight xml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">Unblock-File &lt;&lt;&lt;&lt;  -Path 'D:\Flutter\flutter/bin/internal/update_dart_sdk.ps1</span><br><span class="line">'; &amp; 'D:\Flutter\flutter/bin/internal/update_dart_sdk.ps1'</span><br><span class="line"></span><br><span class="line">  + CategoryInfo          : ObjectNotFound: (Unblock-File:String) [], Comman</span><br><span class="line">    dNotFoundException</span><br><span class="line">  + FullyQualifiedErrorId : CommandNotFoundException</span><br><span class="line">    解决方案：</span><br><span class="line">    powershell升级至5.0并重启计算机即可</span><br></pre></td></tr></table></figure>



</li>
</ul>
<h3 id="创建项目"><a href="#创建项目" class="headerlink" title="创建项目"></a>创建项目</h3><ul>
<li>1、Start a new Flutter project <img src="https://i.loli.net/2020/04/30/HqK3etgyh6VIFmA.png" alt="3.jpg"></li>
<li>2、Flutter Application <img src="https://i.loli.net/2020/04/30/hQY3BijdoJqSMb8.png" alt="4.jpg"></li>
<li>3、Project name <code>bookkeeping</code> <img src="https://i.loli.net/2020/04/30/oVl2KwqiHGQfhMv.png" alt="5.jpg"></li>
<li>4、Company domain <code>yooking.com</code> <img src="https://i.loli.net/2020/04/30/SQ1m9Kz2TgMqbF4.png" alt="6.jpg"></li>
</ul>
<h3 id="HelloWorld"><a href="#HelloWorld" class="headerlink" title="HelloWorld"></a>HelloWorld</h3><p>诸事开头，哈喽world </p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> <span class="string">'package:flutter/material.dart'</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">void</span> main() =&gt; runApp(<span class="keyword">new</span> MyApp());</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MyApp</span> <span class="keyword">extends</span> <span class="title">StatelessWidget</span> </span>&#123;</span><br><span class="line">  <span class="meta">@override</span></span><br><span class="line">  Widget build(BuildContext context) &#123;</span><br><span class="line">    <span class="keyword">return</span> <span class="keyword">new</span> MaterialApp(</span><br><span class="line">      title: <span class="string">'Welcome to Flutter'</span>,</span><br><span class="line">      home: <span class="keyword">new</span> Scaffold(</span><br><span class="line">        appBar: <span class="keyword">new</span> AppBar(</span><br><span class="line">          title: <span class="keyword">new</span> Text(<span class="string">'Welcome to Flutter'</span>),</span><br><span class="line">        ),</span><br><span class="line">        body: <span class="keyword">new</span> Center(</span><br><span class="line">          child: <span class="keyword">new</span> Text(<span class="string">'Hello World'</span>),</span><br><span class="line">        ),</span><br><span class="line">      ),</span><br><span class="line">    );</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>界面效果:<br><img src="https://i.loli.net/2020/04/30/vzS8WPpVumBTAHe.png" alt="7.jpg"></p>
<h3 id="自定义日历页"><a href="#自定义日历页" class="headerlink" title="自定义日历页"></a>自定义日历页</h3><p>自定义日历页面备用:</p>
<ol>
<li><p><code>Column</code>:类似<code>LinearLayout</code>的<code>vertical</code>，自上而下布局</p>
</li>
<li><p><code>Row</code>:类似<code>LinearLayout</code>的<code>horizontal</code>，从左到右布局</p>
</li>
<li><p>日历应该是由数个方块构成，自上而下，每行7个方块，首先创建<code>StateFullWidget</code>:</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">typedef</span> <span class="keyword">void</span> OnDayClickListener(DayModel model);</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">CalendarWidget</span> <span class="keyword">extends</span> <span class="title">StatefulWidget</span> </span>&#123;</span><br><span class="line">	<span class="keyword">final</span> MonthModel _monthModel;</span><br><span class="line">	<span class="keyword">final</span> OnDayClickListener onDayClickListener; <span class="comment">//点击事件回调</span></span><br><span class="line">	CalendarWidget(<span class="keyword">this</span>._monthModel, <span class="keyword">this</span>.onDayClickListener);</span><br><span class="line">	</span><br><span class="line">	<span class="meta">@override</span></span><br><span class="line">	State&lt;StatefulWidget&gt; createState() =&gt; _CalendarWidgetState();</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



</li>
</ol>
<ol start="4">
<li><p>日历整体布局使用<code>Column</code>布局，第一行（<code>Row</code>）为星期</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@override</span></span><br><span class="line">Widget build(BuildContext context) &#123;</span><br><span class="line">    <span class="built_in">double</span> screenWith = MediaQuery.of(context).size.width;</span><br><span class="line">    ...</span><br><span class="line">&#125;</span><br><span class="line">  </span><br><span class="line"><span class="comment"><span class="markdown">/**</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>@param &#123;Object&#125; double screenW 屏幕宽度</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>屏幕宽度只有build后才能获取</span></span></span><br><span class="line"><span class="comment"><span class="markdown"> */</span></span></span><br><span class="line">weekWidget(<span class="built_in">double</span> screenW) &#123;</span><br><span class="line">    <span class="built_in">List</span>&lt;<span class="built_in">String</span>&gt; titleList = &lt;<span class="built_in">String</span>&gt;[<span class="string">'日'</span>, <span class="string">'一'</span>, <span class="string">'二'</span>, <span class="string">'三'</span>, <span class="string">'四'</span>, <span class="string">'五'</span>, <span class="string">'六'</span>,];</span><br><span class="line">    <span class="built_in">List</span>&lt;Widget&gt; widgetList = [];</span><br><span class="line">    titleList.forEach((title) &#123;</span><br><span class="line">        widgetList.add(weekTitleItem(title, (screenW - <span class="number">40</span>) / <span class="number">7</span>));</span><br><span class="line">    &#125;);</span><br><span class="line">    <span class="keyword">return</span> Container(</span><br><span class="line">        width: screenW - <span class="number">40</span>,</span><br><span class="line">        height: <span class="number">17</span>,</span><br><span class="line">        child: Row(</span><br><span class="line">            mainAxisAlignment: MainAxisAlignment.spaceBetween,</span><br><span class="line">            children: widgetList,</span><br><span class="line">        ),</span><br><span class="line">    );</span><br><span class="line">&#125;</span><br><span class="line">  </span><br><span class="line"><span class="comment"><span class="markdown">/**</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>@param &#123;Object&#125; String title 文字</span></span></span><br><span class="line"><span class="comment"><span class="markdown"><span class="bullet"> * </span>@param &#123;Object&#125; double width 单个方框宽度</span></span></span><br><span class="line"><span class="comment"><span class="markdown"> */</span></span></span><br><span class="line">weekTitleItem(<span class="built_in">String</span> title, <span class="built_in">double</span> width) &#123;</span><br><span class="line">    <span class="keyword">return</span> Container(</span><br><span class="line">        alignment: Alignment.center,</span><br><span class="line">        width: width,</span><br><span class="line">        child: Text(</span><br><span class="line">            title,</span><br><span class="line">            style: TextStyle(</span><br><span class="line">                color: ColorUtil.color(<span class="string">'757575'</span>),</span><br><span class="line">                fontSize: <span class="number">12</span>,</span><br><span class="line">            ),</span><br><span class="line">        ),</span><br><span class="line">    );</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>第二到第七行为日期：</p>
<p>5.1 计算本月[空白]天数 - 转换为计算本月1号是周几 其中周日为第一天</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@override</span></span><br><span class="line">Widget build(BuildContext context) &#123;</span><br><span class="line">    ...</span><br><span class="line">    </span><br><span class="line">    <span class="built_in">int</span> weekDay = TimeUtil.getDayOfWeek(</span><br><span class="line">        widget._monthModel.year, widget._monthModel.month, <span class="number">1</span>);</span><br><span class="line">    _emptyDay = weekDay == <span class="number">7</span> ? <span class="number">0</span> : weekDay;</span><br><span class="line">    </span><br><span class="line">    ...</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>5.2 计算本月的日历长度（天） - 转换为获取本月最后一天为几号</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@override</span></span><br><span class="line">Widget build(BuildContext context) &#123;</span><br><span class="line">    ...</span><br><span class="line">    _maxDayOfMonth = TimeUtil.getLastDayOfMonth(</span><br><span class="line">        widget._monthModel.year, widget._monthModel.month);</span><br><span class="line">    </span><br><span class="line">    ...</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>5.3 计算本月的日历实际长度：<code>int length = _emptyDay + _maxDayOfMonth;</code></p>
<p>5.4 计算本月的日历行数：<code>_rows = (length / 7).ceil();</code></p>
<p>5.5 将每日数据加入到日历列表中<code>widgetList</code>并转换为<code>Row</code>列表</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><span class="line">dayWidget(<span class="built_in">int</span> year, <span class="built_in">int</span> month, BuildContext context) &#123;</span><br><span class="line">    <span class="built_in">double</span> screenWith = MediaQuery.of(context).size.width;</span><br><span class="line">    <span class="built_in">List</span>&lt;Widget&gt; widgetList = &lt;Widget&gt;[];</span><br><span class="line">    <span class="keyword">for</span> (<span class="built_in">int</span> i = <span class="number">1</span>; i &lt;= _emptyDay; i++) &#123;</span><br><span class="line">        widgetList.add(emptyDayItem(context));</span><br><span class="line">    &#125;</span><br><span class="line">	</span><br><span class="line">    <span class="keyword">for</span> (<span class="built_in">int</span> i = <span class="number">1</span>; i &lt;= _maxDayOfMonth; i++) &#123;</span><br><span class="line">        widgetList.add(</span><br><span class="line">            dayItem(</span><br><span class="line">                <span class="keyword">new</span> DayModel(TimeUtil.getDate(year, month, i)),</span><br><span class="line">                context</span><br><span class="line">            )</span><br><span class="line">        );</span><br><span class="line">    &#125;</span><br><span class="line">	</span><br><span class="line">    <span class="built_in">List</span>&lt;Row&gt; rowList = &lt;Row&gt;[];</span><br><span class="line">    <span class="keyword">for</span>(<span class="built_in">int</span> i=<span class="number">0</span>;i&lt;_rows;i++)&#123;<span class="comment">//每7天为一行</span></span><br><span class="line">        <span class="built_in">int</span> min = i*<span class="number">7</span>;</span><br><span class="line">        <span class="built_in">int</span> max = i+<span class="number">1</span> == _rows? widgetList.length:(i+<span class="number">1</span>)*<span class="number">7</span>;</span><br><span class="line">        rowList.add(Row(</span><br><span class="line">            children: widgetList.sublist(min,max),</span><br><span class="line">        ));</span><br><span class="line">    &#125;</span><br><span class="line">    </span><br><span class="line">    <span class="keyword">return</span> Container(</span><br><span class="line">        width: screenWith - <span class="number">40</span>,</span><br><span class="line">        height: <span class="number">52.0</span> * _rows,</span><br><span class="line">        child: Column(</span><br><span class="line">            children: rowList,</span><br><span class="line">        ),</span><br><span class="line">    );</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">dayItem(DayModel model, BuildContext context) &#123;</span><br><span class="line">    <span class="built_in">double</span> screenWith = MediaQuery.of(context).size.width;</span><br><span class="line">    <span class="built_in">double</span> singleW = (screenWith - <span class="number">40</span>) / <span class="number">7</span>;</span><br><span class="line">    <span class="built_in">String</span> dayTitle = model.dateTime.day.toString();</span><br><span class="line">    <span class="built_in">bool</span> isAfterToday = model.dateTime.isAfter(<span class="built_in">DateTime</span>.now());<span class="comment">//是否日期在今日之后</span></span><br><span class="line">    <span class="built_in">bool</span> isNoPay = model.pay == <span class="number">0</span>;<span class="comment">//是否无花销</span></span><br><span class="line">    <span class="keyword">return</span> GestureDetector(</span><br><span class="line">        onTap: () &#123;</span><br><span class="line">            <span class="keyword">if</span>(isAfterToday||isNoPay) <span class="keyword">return</span>;</span><br><span class="line">            dayClick(model);<span class="comment">//点击事件</span></span><br><span class="line">        &#125;,</span><br><span class="line">        child: Stack(</span><br><span class="line">            children: &lt;Widget&gt;[</span><br><span class="line">                Container(</span><br><span class="line">                    width: singleW,</span><br><span class="line">                    height: <span class="number">52</span>,</span><br><span class="line">                    alignment: Alignment.center,</span><br><span class="line">                    child: Text(</span><br><span class="line">                        dayTitle,</span><br><span class="line">                        textAlign: TextAlign.center,</span><br><span class="line">                        style: TextStyle(</span><br><span class="line">                            color: isAfterToday||</span><br><span class="line">                            	isNoPay ? ColorUtil.color(<span class="string">'BDBDBD'</span>): ColorUtil.color(<span class="string">'212121'</span>),</span><br><span class="line">                            fontSize: <span class="number">15</span>,</span><br><span class="line">                        ),</span><br><span class="line">                    ),</span><br><span class="line">                ),</span><br><span class="line">            ],</span><br><span class="line">        ),</span><br><span class="line">    );</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">emptyDayItem(BuildContext context) &#123;</span><br><span class="line">    <span class="built_in">double</span> screenWith = MediaQuery.of(context).size.width;</span><br><span class="line">    <span class="built_in">double</span> singleW = (screenWith - <span class="number">40</span>) / <span class="number">7</span>;</span><br><span class="line">    <span class="keyword">return</span> Container(</span><br><span class="line">        width: singleW,</span><br><span class="line">        height: <span class="number">52</span>,</span><br><span class="line">    );</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>5.6 将所有<code>Row</code>放入<code>Column</code>中排列</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@override</span></span><br><span class="line">Widget build(BuildContext context) &#123;</span><br><span class="line">    ...</span><br><span class="line">    <span class="keyword">return</span> Container(</span><br><span class="line">        width: screenWith,</span><br><span class="line">        height: <span class="number">24.0</span> + <span class="number">17.0</span> + <span class="number">13</span> + _rows * <span class="number">52.0</span>  ,</span><br><span class="line">        child: Column(</span><br><span class="line">            children: &lt;Widget&gt;[</span><br><span class="line">                SizedBox(</span><br><span class="line">                    height: <span class="number">24</span>,</span><br><span class="line">                ),</span><br><span class="line">                weekWidget(screenWith),</span><br><span class="line">                SizedBox(</span><br><span class="line">                    height: <span class="number">13</span>,</span><br><span class="line">                ),</span><br><span class="line">                dayWidget(widget._monthModel.year, widget._monthModel.month, context),</span><br><span class="line">            ],</span><br><span class="line">        ),</span><br><span class="line">    );</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p>5.7 赋予日历点击事件</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">dayClick(DayModel model) &#123;</span><br><span class="line">    widget.onDayClickListener(model);</span><br><span class="line">    setState(() &#123;&#125;);<span class="comment">//刷新当前页面（即整个CalendarWidget的build）</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>在<code>CalendarPage</code>中调用<code>CalendarWidget</code>并添加滑动事件</p>
<figure class="highlight dart"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">CalendarPage</span> <span class="keyword">extends</span> <span class="title">StatefulWidget</span> </span>&#123;</span><br><span class="line">    <span class="meta">@override</span></span><br><span class="line">    State&lt;StatefulWidget&gt; createState() =&gt; _CalendarPageState();</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">_CalendarPageState</span> <span class="keyword">extends</span> <span class="title">State</span>&lt;<span class="title">CalendarPage</span>&gt; </span>&#123;</span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">final</span> maxYear = <span class="built_in">DateTime</span>.now().year;</span><br><span class="line">    <span class="keyword">static</span> <span class="keyword">final</span> maxMonth = <span class="built_in">DateTime</span>.now().month;</span><br><span class="line">    MonthModel _monthModel = <span class="keyword">new</span> MonthModel(maxYear, maxMonth);</span><br><span class="line"></span><br><span class="line">    <span class="meta">@override</span></span><br><span class="line">    Widget build(BuildContext context) &#123;</span><br><span class="line">        <span class="keyword">final</span> data = MediaQuery.of(context);</span><br><span class="line">        <span class="keyword">final</span> screenHeight = data.size.height;</span><br><span class="line">        <span class="keyword">final</span> screenWidth = data.size.width;</span><br><span class="line">        <span class="comment">//获取当前日期作为标题</span></span><br><span class="line">        <span class="built_in">num</span> dx,dy;</span><br><span class="line">        <span class="keyword">return</span> Scaffold(</span><br><span class="line">            appBar: <span class="keyword">new</span> AppBar(</span><br><span class="line">                title: <span class="keyword">new</span> Text(<span class="string">"<span class="subst">$&#123;_monthModel.year&#125;</span>.<span class="subst">$&#123;_monthModel.month&#125;</span>"</span>),</span><br><span class="line">            ),</span><br><span class="line">            body: Listener(</span><br><span class="line">                onPointerDown: (event)&#123;<span class="comment">//监听按下</span></span><br><span class="line">                    dx = event.position.dx;</span><br><span class="line">                &#125;,</span><br><span class="line">                onPointerUp: (event)&#123;<span class="comment">//监听抬起</span></span><br><span class="line">                    <span class="built_in">num</span> delX = event.position.dx - dx;</span><br><span class="line">                    <span class="built_in">num</span> delY = event.position.dy - dy;</span><br><span class="line">                    <span class="keyword">if</span>((delX / delY).abs() &lt; <span class="number">2.7</span> ) <span class="keyword">return</span>;<span class="comment">//cot 20°≈ 2.7 cot越小，角度越大</span></span><br><span class="line">                    <span class="keyword">if</span>(delX &gt; <span class="number">50</span>) updateMonth(<span class="number">-1</span>);<span class="comment">//左滑则月份-1</span></span><br><span class="line">                    <span class="keyword">else</span> <span class="keyword">if</span>(delX &lt; <span class="number">-50</span>) updateMonth(<span class="number">1</span>);<span class="comment">//右滑则月份+1</span></span><br><span class="line">                &#125;,</span><br><span class="line">                child: Container(</span><br><span class="line">                    height: screenHeight,</span><br><span class="line">                    width: screenWidth,</span><br><span class="line">                    color: Colors.white,</span><br><span class="line">                    padding: <span class="keyword">const</span> EdgeInsets.symmetric(horizontal: <span class="number">10.0</span>, vertical: <span class="number">10.0</span>),</span><br><span class="line">                    alignment: Alignment.topCenter,</span><br><span class="line">                    child: <span class="keyword">new</span> CalendarWidget(</span><br><span class="line">                        _monthModel,</span><br><span class="line">                        (dayModel) &#123;<span class="comment">//每日点击事件</span></span><br><span class="line">                            <span class="comment">//todo:打开详情页面</span></span><br><span class="line">                            MyToast().showToast(TimeUtil.formatDate(dayModel.dateTime) +</span><br><span class="line">                                <span class="string">"花费了"</span> +</span><br><span class="line">                                dayModel.pay.toString() +</span><br><span class="line">                                <span class="string">"元"</span>);</span><br><span class="line">                        &#125;,</span><br><span class="line">                    ),</span><br><span class="line">                )</span><br><span class="line">            ),</span><br><span class="line">        );</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    updateMonth(changeMonth)&#123;</span><br><span class="line">        _monthModel.month += changeMonth;</span><br><span class="line">        <span class="keyword">if</span>(_monthModel.month &gt; <span class="number">12</span>)&#123;</span><br><span class="line">            _monthModel.month -= <span class="number">12</span>;</span><br><span class="line">            _monthModel.year ++;</span><br><span class="line">        &#125;<span class="keyword">else</span> <span class="keyword">if</span>(_monthModel.month &lt; <span class="number">1</span>)&#123;</span><br><span class="line">            _monthModel.month += <span class="number">12</span>;</span><br><span class="line">            _monthModel.year --;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span>(TimeUtil.getDate(_monthModel.year, _monthModel.month, <span class="number">1</span>)</span><br><span class="line">            .isAfter(<span class="built_in">DateTime</span>.now())) &#123;</span><br><span class="line">            <span class="comment">//不可超过本月</span></span><br><span class="line">            _monthModel.year = maxYear;</span><br><span class="line">            _monthModel.month = maxMonth;</span><br><span class="line">            <span class="keyword">return</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        setState(() &#123;&#125;);<span class="comment">//刷新当前build</span></span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>效果演示<br><img src="https://i.loli.net/2020/04/30/T37HXri18xBtsIh.png" alt="8.jpg"></p>
</li>
</ol>
<!--## 开发进度
网络请求: [Retrofit](https://github.com/square/retrofit)
事件发布-订阅总线: [EventBus](https://github.com/greenrobot/EventBus)
recyclerview: [BRVAH](http://www.recyclerview.org/)

### 2019.11.18 HelloWorld 
1.Start A New Android Studio project
![](../../../../imgs/从零开始记账本/2.jpg)
2.Configure Project
![](../../../../imgs/从零开始记账本/3.jpg)-->

<!--1.记录支出、收益
    记录后自动累计当天金额
    并且可以选择付款途径，是花呗 余额 银行卡或者其它
    例：
    用户：2019.11.11 00:07 支出66元（花呗）
    用户：2019.11.11 00:35 支出44元（花呗）
    系统小字：2019.11.11累计已支出110元（花呗）
    2.可以预设每月生活支出预算，但非必填，有明显图标可以选择跳过
    3.背景图案可导入手机相册照片（参考手机qq皮肤设置，多个界面各自导入照片做背景）
    4.每周生成一副支出金额曲线图，支出类别占比饼状图
    4.1用户可以预设“非必要支出”项目类型，比如嚯奶茶之类的支出，在统计界面标明支出占比
    5.大致三个界面，从左到右
    记录→统计→用户界面
    5.1记录界面，参考各大记账app；用户自定义增加分类，可隐藏不常用分类，分类项目可以搜索
    5.2统计界面：周支出（收入）曲线图，支出金额占比曲线图，非必要支出占比，月日历（日期下方显示支出/收入金额-有按钮可以选择切换是显示支出，还是显示收入）
    6.设有花呗 信用卡还款日期提示-->
    </div>

    
    
    
        <div class="reward-container">
  <div><font color="#FF0000">------------本文结束<i class="fa fa-paw"></i>感谢您的阅读------------</font><br/><br/>Thank you for your accept！</div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/imgs/a_icon_pay_wechat.png" alt="yooking 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/imgs/a_icon_pay_ali.png" alt="yooking 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

	  

      <footer class="post-footer">
		<div>
			
				
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>
  
  <!-- JS库 sweetalert 可修改路径 -->
  <script type="text/javascript" src="http://jslibs.wuxubj.cn/sweetalert_mini/jquery-1.7.1.min.js"></script>
  <script src="http://jslibs.wuxubj.cn/sweetalert_mini/sweetalert.min.js"></script>
  <link rel="stylesheet" type="text/css" href="http://jslibs.wuxubj.cn/sweetalert_mini/sweetalert.mini.css">

  <p><span>本文标题:</span>项目开发-从零开始记账本</a></p>
  <p><span>文章作者:</span>yooking</a></p>
  <p><span>发布时间:</span>2019年11月18日 - 11:25:39</p>
  <p><span>最后更新:</span>2020年05月14日 - 18:59:13</p>
  <p><span>原始链接:</span><a href="/dev/191118-bookkeeping.html" title="项目开发-从零开始记账本">http://blog.yookingh.cn/dev/191118-bookkeeping.html</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="http://blog.yookingh.cn/dev/191118-bookkeeping.html"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span>© <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
    clipboard.on('success', $(function(){
      $(".fa-clipboard").click(function(){
        swal({   
          title: "",   
          text: '复制成功',   
          html: false,
          timer: 500,   
          showConfirmButton: false
        });
      });
    }));  
</script>

			
		</div>
          
          <div class="post-tags">
              <a href="/tags/Java/" rel="tag"><i class="fa fa-tag"></i> Java</a>
              <a href="/tags/Flutter/" rel="tag"><i class="fa fa-tag"></i> Flutter</a>
              <a href="/tags/Dart/" rel="tag"><i class="fa fa-tag"></i> Dart</a>
              <a href="/tags/proj/" rel="tag"><i class="fa fa-tag"></i> 项目开发</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/dev/190924-hotfix.html" rel="prev" title="Android热补丁技术初探">
      <i class="fa fa-chevron-left"></i> Android热补丁技术初探
    </a></div>
      <div class="post-nav-item">
    <a href="/dev/200424-accessibilityService.html" rel="next" title="Android辅助功能开发-一键优化">
      Android辅助功能开发-一键优化 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">
      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#大事记"><span class="nav-number">1.</span> <span class="nav-text">大事记</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#公司大事件"><span class="nav-number">1.1.</span> <span class="nav-text">公司大事件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#项目时间轴"><span class="nav-number">1.2.</span> <span class="nav-text">项目时间轴</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#文档路径"><span class="nav-number">1.3.</span> <span class="nav-text">文档路径</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#开发笔记"><span class="nav-number">2.</span> <span class="nav-text">开发笔记</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#开发环境"><span class="nav-number">2.1.</span> <span class="nav-text">开发环境</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#System-And-Software"><span class="nav-number">2.2.</span> <span class="nav-text">System And Software</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#开发规划"><span class="nav-number">2.3.</span> <span class="nav-text">开发规划</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#开发进度"><span class="nav-number">2.4.</span> <span class="nav-text">开发进度</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#开发详情"><span class="nav-number">2.5.</span> <span class="nav-text">开发详情</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#环境配置"><span class="nav-number">2.5.1.</span> <span class="nav-text">环境配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#创建项目"><span class="nav-number">2.5.2.</span> <span class="nav-text">创建项目</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HelloWorld"><span class="nav-number">2.5.3.</span> <span class="nav-text">HelloWorld</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#自定义日历页"><span class="nav-number">2.5.4.</span> <span class="nav-text">自定义日历页</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="yooking"
      src="/imgs/a_icon_head.jpg">
  <p class="site-author-name" itemprop="name">yooking</p>
  <div class="site-description" itemprop="description"></div>
</div>

<div id="music_163">
	<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" height=86 src="//music.163.com/outchain/player?type=2&id=1417959188&auto=1&height=66"></iframe>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives">
          <span class="site-state-item-count">23</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/yooking-git" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;yooking-git" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:android_yoo@126.com" title="E-Mail → mailto:android_yoo@126.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title"><i class="fa fa-link fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://www.chensheng.group/" title="https:&#x2F;&#x2F;www.chensheng.group&#x2F;" rel="noopener" target="_blank">陈先生的小前端</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://github.com/theme-next" title="https:&#x2F;&#x2F;github.com&#x2F;theme-next" rel="noopener" target="_blank">NexT主题Github</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://hexo-theme-next.netlify.app/" title="https:&#x2F;&#x2F;hexo-theme-next.netlify.app&#x2F;" rel="noopener" target="_blank">NexT主题博客</a>
        </li>
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2019 – 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">yooking</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">118k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">1:47</span>
</div>
<div>
<span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span>
<script>
    var now = new Date();
    function createtime() {
        var grt= new Date("04/07/2019 00:00:00");
        now.setTime(now.getTime()+250);
        days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days);
        hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours);
        if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
        mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;}
        seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
        snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;}
        document.getElementById("timeDate").innerHTML = "本站已安全运行 "+dnum+" 天 ";
        document.getElementById("times").innerHTML = hnum + " 小时 " + mnum + " 分 " + snum + " 秒";
    }
setInterval("createtime()",250);
</script>
</div>


  <script src='https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js'></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize({theme: 'forest'});
    }
  </script>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script color='0,0,0' opacity='0.7' zIndex='-1' count='140' src="/lib/canvas-nest/canvas-nest-nomobile.min.js"></script>
  <script size="300" alpha="0.1" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

<script src="/js/bookmark.js"></script>




  




  
<script src="/js/local-search.js"></script>









<script>
document.querySelectorAll('.pdfobject-container').forEach(element => {
  let url = element.dataset.target;
  let pdfOpenParams = {
    navpanes : 0,
    toolbar  : 0,
    statusbar: 0,
    pagemode : 'thumbs',
    view     : 'FitH'
  };
  let pdfOpenFragment = '#' + Object.entries(pdfOpenParams).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).join('&');
  let fullURL = `/lib/pdf/web/viewer.html?file=${encodeURIComponent(url)}${pdfOpenFragment}`;

  if (NexT.utils.supportsPDFs()) {
    element.innerHTML = `<embed class="pdfobject" src="${url + pdfOpenFragment}" type="application/pdf" style="height: ${element.dataset.height};">`;
  } else {
    element.innerHTML = `<iframe src="${fullURL}" style="height: ${element.dataset.height};" frameborder="0"></iframe>`;
  }
});
</script>


<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'default',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'uutufTwYVUeCtemIaV78RUzY-gzGzoHsz',
      appKey     : 'EWtCrVS44F22gkjWkQ15x4lx',
      placeholder: "恭迎评论指教（Your comments and criticisms are always welcome.）",
      avatar     : 'mp',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
